package com.xiguthings.waka.service.base;

import java.util.List;

import com.xiguthings.waka.command.CodeConstant;
import com.xiguthings.waka.po.extpo.Page;

public interface IBaseService<T, TExample> {


    public static final int CODE_SUCCESS = CodeConstant.CODE_SUCCESS;// 访问成功
    public static final int CODE_FAULT = CodeConstant.CODE_FAULT;// 操作失败


    public static final int CODE_EMPTY_REQUIRED = CodeConstant.CODE_EMPTY_REQUIRED;// 必填参数为空
    public static final int CODE_NEVER_FOUND = CodeConstant.CODE_NEVER_FOUND;// 未知的错误


    int countByExample(TExample example) throws Exception;

    int deleteByExample(TExample example) throws Exception;

    int deleteByPrimaryKey(String id) throws Exception;

    int insert(T t) throws Exception;

    int insertSelective(T t) throws Exception;

    List<T> selectByExample(TExample example) throws Exception;

    T selectByPrimaryKey(String id) throws Exception;

    int updateByExampleSelective(T t, TExample example) throws Exception;

    int updateByExample(T t, TExample example) throws Exception;

    int updateByPrimaryKeySelective(T t) throws Exception;

    int updateByPrimaryKey(T t) throws Exception;

    Page selectByPage(Page pageEntity, TExample example) throws Exception;
}

